#!/usr/bin/env python3 
# -*- coding: UTF-8 -*-

'''
测试百度首页
by lina
'''
from src.gui.page import base_page

class CsdnIndex(base_page.BasePage):

	def __init__(self):
		super().__init__()
		self.index_url = 'https://www.csdn.net/'


	"""
	进入当前页面
	by lina
	"""
	def in_this_page(self):
		self.mlog.add_log('CsdnIndex','in_this_page','进入csdn首页')
		self.mscreenshot.add_screenshot(self.driver,'csdn_index')
		self.driver.get(self.index_url)

	"""
	刷新当前页面
	by lina
	"""
	def refresh_page(self):
		self.mlog.add_log('CsdnIndex','refresh_page','刷新csdn首页')
		self.driver.refresh

	"""
	进入登陆页面
	by lina
	"""
	def link_to_login(self):
		self.mlog.add_log('CsdnIndex','link_to_login','前往登陆页')
		super().to_last_window()
		super().delay_time()
		self.driver.get(self.driver.find_element_by_xpath("//a[contains(text(),'登录')]").get_attribute('href'))
		super().delay_time()


